<?php
header('content-type:text/html;charset=utf-8');
$link=mysqli_connect('localhost','root','');
if(!$link){
    die('连接数据库失败！');
}
mysqli_query($link,'set name utf8');
mysqli_query($link,'use `itcast`');
$where = '';
if(isset($_GET['keyword'])){
    $keyword =   $_GET['keyword'];
    $keyword = mysqli_real_escape_string($keyword);
    $where = "where e_name like '%$keyword%'";
}
$sql="select*from `emp_info` $where";
$result=mysqli_query($link,$sql);
$emp_info=array();
while($row=mysqli_fetch_assoc($result)){
    $emp_info[]=$row;
}
define('APP','itcast');
require'./list_html.php';